package com.bit.book.enmus;

import lombok.Getter;
import lombok.Setter;

public enum BookStaus {
    DELETE(0,"无效"),
    NORMAL(1,"可借约"),
    FORBIDDEN(2,"不可借约");
    @Setter
    @Getter
    private int code;
    @Setter
    @Getter
    private String desc;
    BookStaus(int code,String desc) {
        this.code = code;
        this.desc = desc;
    }
    BookStaus() {
    }
    public static BookStaus getNameByCode(Integer code) {
        switch (code) {
            case 0: return BookStaus.DELETE;
            case 1: return BookStaus.NORMAL;
            case 2: return BookStaus.FORBIDDEN;
        }
        return null;
    }

}
